<template>
  <view style="padding: 10upx 20upx">
    <view class="enter">
      <view class="enter_title">企业信息</view>
      <!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
      <u--form
        labelPosition="left"
        :model="model1"
        :rules="rules"
        ref="uForm"
        labelWidth="auto"
        :labelStyle="{ fontSize: '12px' }"
      >
        <u-form-item label="企业名称" prop="qiye_name">
          <u--input v-model="model1.qiye_name" border="none"></u--input>
        </u-form-item>
        <u-form-item label="负责人姓名" prop="user_name">
          <u--input v-model="model1.user_name" border="none"></u--input>
        </u-form-item>
        <!-- <u-form-item label="职务" prop="sex" >
                    <u--input v-model="model1.name" border="none"></u--input>
                </u-form-item> -->
        <u-form-item label="联系电话" prop="user_phone">
          <u--input v-model="model1.user_phone" border="none"></u--input>
        </u-form-item>
        <u-form-item label="省市" prop="area_id">
          <u--input v-model="model1.area_id" border="none"></u--input>
        </u-form-item>
        <u-form-item label="企业注册资金" prop="balance">
          <u--input v-model="model1.nabalanceme" border="none"></u--input>
        </u-form-item>
        <u-form-item label="企业年收入" prop="sex">
          <u--input v-model="model1.name" border="none"></u--input>
        </u-form-item>
        <u-form-item label="所属行业赛道" prop="sex">
          <u--input v-model="model1.name" border="none"></u--input>
        </u-form-item>
      </u--form>
    </view>
    <view class="enter">
      <view class="enter_title">补充内容</view>
      <!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
      <u--textarea
        v-model="value1"
        placeholder="请输入内容"
        border
      ></u--textarea>
      <view>
        <view class="enter_label">上传资料（营业执照、名片等）</view>
        <u-upload name="1" multiple :maxCount="10"></u-upload>
      </view>
    </view>
    <view class="custom">
      <u-button type="primary" shape="circle" @click="submit">提交</u-button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      showSex: false,
      model1: {
        userInfo: {
          name: "",
          sex: "",
        },
      },
      value1: "",
      actions: [
        {
          name: "男",
        },
        {
          name: "女",
        },
        {
          name: "保密",
        },
      ],
      rules: {
        qiye_name: {
          type: "string",
          required: true,
          message: "请填写企业名称",
          trigger: ["blur", "change"],
        },
        user_name: {
          type: "string",
          required: true,
          message: "请填写负责人姓名",
          trigger: ["blur", "change"],
        },
        user_title: {
          type: "string",

          required: true,
          message: "请填写职务",
          trigger: ["blur", "change"],
        },
        user_phone: {
          type: "string",

          required: true,
          message: "请填写联系电话",
          trigger: ["blur", "change"],
        },
        
        area_id: {
          type: "string",
          required: true,
          message: "请选择地区",
          trigger: ["blur", "change"],
        },
        balance: {
          type: "string",

          required: true,
          message: "请填写企业注册资金",
          trigger: ["blur", "change"],
        },
        qiye_year_balance: {
          type: "string",

          required: true,
          message: "请填写企业年收入",
          trigger: ["blur", "change"],
        },
        saidao_id: {
          type: "string",

          required: true,
          message: "请填写所属赛道",
          trigger: ["blur", "change"],
        },
      },
      radio: "",
      switchVal: false,
    };
  },
  methods: {
    sexSelect(e) {
      this.model1.sex = e.name;
      this.$refs.uForm.validateField("sex");
    },
    submit() {
      this.$refs.uForm
        .validate()
        .then((res) => {
          uni.$u.toast("校验通过");
        })
        .catch((errors) => {
          uni.$u.toast("校验失败");
        });
    },
  },
  onReady() {
    //如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
    this.$refs.uForm.setRules(this.rules);
  },
};
</script>
<style scoped lang="scss">
.enter {
  background: #ffffff;
  box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.1);
  border-radius: 8upx;
  padding: 20upx;
  .enter_title {
    padding-bottom: 20upx;
    border-bottom: 1px solid #f0f0f0;
  }
  .enter_label {
    font-size: 20upx;
    margin-bottom: 10upx;
  }
}
.custom {
  margin-top: 20upx;
}
</style>
